package cn.itcast.syntax

/**
  * @Package cn.itcast.syntax
  * @author KTL
  * @date 2021/5/14 0014 17:35
  * @version V1.0
  * @Copyright © 2015-04-29  One for each, and two for each
  *           desc 演示scala块表达式
  */
object Demo04_BlockExperssion {
  def main(args: Array[String]): Unit = {
    var a:Int=2
    val b:Int=3
    val result:Int=a+b;
    /**
      * 块表达式的最后一行就是整个块表达式的值
      */
    val result1:Int={
      a+b
    }
    val result2:Int={
      a+b
      0
    }
    println(result+"--"+result1+"--"+result2)
  }
}
